/** @method useActionsData
 *  @description 获取项目的数据
 *  @return Array
 */
import { useEffect, useState } from 'react';
import services from '../services/api';

export default function useProjectData() {
  const [project, setProject] = useState([]);

  useEffect(() => {
    services.project.listNoPage().then(({ code, data }) => {
      if (code === '0') {
        setProject(data);
      }
    });
  }, []);

  return project;
}
